package Test
{
	import Engine.Model.LoaderManager;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	
	public class TestPng extends Sprite
	{
		
		private var testbitdata:BitmapData = null;
		private var loading:LoaderManager;
		
		public function TestPng()
		{
			super();
			loading = new LoaderManager();
			loading.loadImage("config/ball_1_2.png",onCompulete);
			loading.startloading();
		}
		
		private function onCompulete(bit:BitmapData,path:String):void
		{
//			this.testbitdata = bit;
//			trace(bit.width,bit.height);
//			var r:Rectangle = bit.getColorBoundsRect(0xFF000000,0x00000000,false);
//			trace(r.width,r.height,r.x,r.y);
			if(this.testbitdata != null)
			{
				this.testbitdata.copyPixels(this.testbitdata,new Rectangle(0,0,this.testbitdata.width,this.testbitdata.height),new Point(10,10),null,null,true);
				this.addChild(new Bitmap(this.testbitdata));
				return;
			}
			this.testbitdata = bit;
//			for(var y:int = 0;y<this.testbitdata.height;y++)
//			{
//				for(var x:int = 0; x<this.testbitdata.width;x++)
//					trace(this.testbitdata.getPixel(x,y));
//			}
			loading.loadImage("config/ball_1_2.png",onCompulete);
			loading.startloading();
		}
	}
	
	
}